package cn.anecansaitin.whimsy.common.register;

import cn.anecansaitin.whimsy.Whimsy;
import cn.anecansaitin.whimsy.common.enchantment.*;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentCategory;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;

public class ModEnchantments {
    public static DeferredRegister<Enchantment> ENCHANTMENTS = DeferredRegister.create(Registries.ENCHANTMENT, Whimsy.MODID);

    public static DeferredHolder<Enchantment, ArrowRest> ARROW_REST = ENCHANTMENTS.register("arrow_rest", ArrowRest::new);
    public static DeferredHolder<Enchantment, AutomaticTrigger> AUTOMATIC_TRIGGER = ENCHANTMENTS.register("automatic_trigger", AutomaticTrigger::new);
    public static DeferredHolder<Enchantment, RapidFire> RAPID_FIRE = ENCHANTMENTS.register("rapid_fire", RapidFire::new);
    public static DeferredHolder<Enchantment, Phantasm> PHANTASM = ENCHANTMENTS.register("phantasm", Phantasm::new);
    public static DeferredHolder<Enchantment, ManualMotorCoordination> MANUAL_MOTOR_COORDINATION = ENCHANTMENTS.register("manual_motor_coordination", ManualMotorCoordination::new);
    public static DeferredHolder<Enchantment, SimpleEnchantment> EAGLE_VIEW = ENCHANTMENTS.register("eagle_view", () -> new SimpleEnchantment(Enchantment.Rarity.COMMON, EnchantmentCategory.BOW, new EquipmentSlot[]{EquipmentSlot.MAINHAND}));

    public static class SimpleEnchantment extends Enchantment {
        private SimpleEnchantment(Rarity rarity, EnchantmentCategory category, EquipmentSlot[] applicableSlots) {
            super(rarity, category, applicableSlots);
        }
    }
}